package com.lysj.website.auth.domain;


import com.lysj.website.common.spring.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @author zk
 * @description 用户表
 * @create 2018-07-25 14:55
 **/
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@Table(name = "lysj_auth_user")
public class User extends BaseEntity {


    @Getter
    public enum Status {
        ENABLE(1, "启用"),
        DISABLE(2, "禁用");

        private Integer code;
        private String status;

        Status(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }


    @Getter
    public enum SEX {
        MAN(1, "男"),
        WOMEN(2, "女");

        private Integer code;
        private String status;

        SEX(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }

    private String username;//用户名，登录账号，必填

    private String password;//密码 必填

    private String phone;//联系电话 选用

    private String email;//邮箱 选用

    private String companyId;//公司id

    private Integer status;//员工状态

    private Integer sex;//员工性别

    @Transient
    private String level;//级别

    @Transient
    private String companyName;


    @Transient
    private List<Permission> permissions;//用户拥有的权限

    @Transient
    private List<Role> roles;//用户拥有的角色
}
